<div class="modal " ng-controller="RestoreController">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" ng-click="$hide()" aria-hidden="true">×
        </button>
        <h3>Restore Backup to <b>{{restored.target}}</b></h3>
      </div>
      <div class="modal-body edge">

        <div class="row">

          <div class="col-md-12">
            <form id="signin" name="newDB" class="form-horizontal" novalidate="">
              <fieldset>
                <div class="form-group">
                  <label class="control-label col-md-2">Database name</label>
                  <div class="col-md-10">
                    <input type="text" class="form-control" required ng-model="restored.target"
                           placeholder="Database name" focus="true"/>
                  </div>
                </div>
              </fieldset>
            </form>
          </div>
        </div>

        <div class="row">

          <div class="col-md-12">

            <div class="studio-well">
              <p>
                The selected backup is part of an incremental backup.
                Below are the files (<b>{{unitLogs.length}}</b>) involved . The restore will use all the files stored
                in <b>{{restored.log.path}}</b> to
                restore the database.
              </p>
            </div>
          </div>
        </div>
        <br/>
        <div class="row">

          <div class="col-md-12">
            <table class="table table-striped  table-fixed-header table-backup">
              <thead>
              <tr>
                <th>Mode</th>
                <th>When</th>
                <th>File Name</th>
                <th>File Size</th>
              </tr>
              </thead>
              <tbody>
              <tr ng-repeat="u in unitLogs">
                <td>{{ u.mode }}</td>
                <td>{{ u.timestamp | formatDateNS}}</td>
                <td>{{ u.fileName }}</td>
                <td>{{ u.fileSize | toSizeString }}</td>
              </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" ng-click="$hide()">Cancel</button>
        <button class="btn btn-primary" ng-disabled="newDB.$invalid" ng-click="onRestore(restored,$hide)">Restore
        </button>
      </div>
    </div>
  </div>
</div>


